#pragma once

#include "includeBase.h"

#include "../common/BasePclModel.h"

class PclRegionGrowingModel : public BasePclModel
{

public:
    PclRegionGrowingModel();

public:
    static PclRegionGrowingModel& get();

public: // IJsonSerializable
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    QJsonObject toJson() const override;

public: // Property
    inline QString pcdFile() const { return pcdFile_; }
    inline void setPcdFile(const QString& pcdFile) { pcdFile_ = pcdFile; }

    int kSearch() const { return kSearch_; }
    void setKSearch(int kSearch) { kSearch_ = kSearch; }

    int minClusterSize() const { return minClusterSize_; }
    void setMinClusterSize(int minClusterSize) { minClusterSize_ = minClusterSize; }

    int maxClusterSize() const { return maxClusterSize_; }
    void setMaxClusterSize(int maxClusterSize) { maxClusterSize_ = maxClusterSize; }

    int numberOfNeighbours() const { return numberOfNeighbours_; }
    void setNumberOfNeighbours(int numberOfNeighbours) { numberOfNeighbours_ = numberOfNeighbours; }

    double smoothnessThreshold() const { return smoothnessThreshold_; }
    void setSmoothnessThreshold(double smoothnessThreshold) { smoothnessThreshold_ = smoothnessThreshold; }

    double curvatureThreshold() const { return curvatureThreshold_; }
    void setCurvatureThreshold(double curvatureThreshold) { curvatureThreshold_ = curvatureThreshold; }

private:
    QString pcdFile_ = "<pcl-data>/tutorials/region_growing_tutorial.pcd";

    int kSearch_ = 50;
    int minClusterSize_ = 50;
    int maxClusterSize_ = 1000000;
    int numberOfNeighbours_ = 30;
    double smoothnessThreshold_ = 3.0;
    double curvatureThreshold_ = 1.0;
};
